import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';


export const querySchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    fieldName: 'originalSaleId',
    label: '原始销售订单ID',
  },
  {
    component: 'Input',
    fieldName: 'originalProductId',
    label: '原始订单中未提货的产品ID',
  },
  {
    component: 'Input',
    fieldName: 'originalProductName',
    label: '原始订单中未提货的产品名称 (冗余)',
  },
  {
    component: 'Input',
    fieldName: 'originalUnfulfilledQuantity',
    label: '原始订单中未提货时剩余的数量',
  },
  {
    component: 'Input',
    fieldName: 'supplementaryProductId',
    label: '实际补充提货的产品ID',
  },
  {
    component: 'Input',
    fieldName: 'supplementaryProductName',
    label: '实际补充提货的产品名称 (冗余)',
  },
  {
    component: 'Input',
    fieldName: 'supplementaryQuantity',
    label: '实际补充提货的数量',
  },
  {
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
    fieldName: 'pickupTime',
    label: '补充提货时间',
  },
  {
    component: 'Input',
    fieldName: 'pickupDeptId',
    label: '提货店铺ID',
  },
  {
    component: 'Input',
    fieldName: 'pickupDeptName',
    label: '提货店铺名称 (冗余)',
  },
  {
    component: 'Input',
    fieldName: 'operatorId',
    label: '操作人ID',
  },
  {
    component: 'Input',
    fieldName: 'operatorName',
    label: '操作人姓名 (冗余)',
  },
  {
    component: 'Textarea',
    fieldName: 'reason',
    label: '补充提货原因 (例如：原产品缺货，客户同意更换)',
  },
  {
    component: 'Textarea',
    fieldName: 'proofFiles',
    label: '证明材料',
  },
  {
    component: 'RadioGroup',
    componentProps: {
      buttonStyle: 'solid',
      optionType: 'button',
    },
    fieldName: 'status',
    label: '状态',
  },
];

// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
  { type: 'checkbox', width: 60 },
  {
    title: '补充提货记录ID',
    field: 'supplementaryPickupId',
  },
  {
    title: '原始销售订单ID',
    field: 'originalSaleId',
  },
  {
    title: '原始订单中未提货的产品ID',
    field: 'originalProductId',
  },
  {
    title: '原始订单中未提货的产品名称 (冗余)',
    field: 'originalProductName',
  },
  {
    title: '原始订单中未提货时剩余的数量',
    field: 'originalUnfulfilledQuantity',
  },
  {
    title: '实际补充提货的产品ID',
    field: 'supplementaryProductId',
  },
  {
    title: '实际补充提货的产品名称 (冗余)',
    field: 'supplementaryProductName',
  },
  {
    title: '实际补充提货的数量',
    field: 'supplementaryQuantity',
  },
  {
    title: '补充提货时间',
    field: 'pickupTime',
  },
  {
    title: '提货店铺ID',
    field: 'pickupDeptId',
  },
  {
    title: '提货店铺名称 (冗余)',
    field: 'pickupDeptName',
  },
  {
    title: '操作人ID',
    field: 'operatorId',
  },
  {
    title: '操作人姓名 (冗余)',
    field: 'operatorName',
  },
  {
    title: '补充提货原因 (例如：原产品缺货，客户同意更换)',
    field: 'reason',
  },
  {
    title: '证明材料',
    field: 'proofFiles',
  },
  {
    title: '状态',
    field: 'status',
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 180,
  },
];

